<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading">
                添加
            </header>
            <div class="panel-body">
                <div class="form">
                    <form class="cmxform form-horizontal tasi-form" name="myForm" novalidate="novalidate">
                        <input ng-hide="true" ng-model="admin.id"/>
                        <div class="form-group" ng-class="{'has-error': myForm.name.$dirty && myForm.name.$invalid}">
                            <label class="control-label col-lg-2">用户名</label>
                            <div class="col-lg-5">
                                <input class="form-control" name="name" ng-required="true" ng-maxlength="10"
                                       ng-model="admin.a_name" type="text">
                            </div>
                            <div ng-show="myForm.name.$dirty && myForm.name.$error.maxlength"
                                 class="alert alert-danger help-block">
                                不能超过5个字符
                            </div>
                        </div>
                        <div class="form-group" ng-class="{'has-error': myForm.tel.$dirty && myForm.tel.$invalid }">
                            <label class="control-label col-lg-2">电话号码</label>
                            <div class="col-lg-5">
                                <input class="form-control" name="tel" ng-required="true" ng-maxlength="11"
                                       ng-model="admin.a_tel" type="text">
                            </div>
                            <div ng-show="myForm.tel.$dirty && myForm.tel.$error.maxlength"
                                 class="alert alert-danger help-block">
                                不能超过11个字符
                            </div>
                        </div>
                        <div class="form-group"
                             ng-class="{'has-error': myForm.loginName.$dirty && myForm.loginName.$invalid }">
                            <label class="control-label col-lg-2">登陆名</label>
                            <div class="col-lg-5">
                                <input class="form-control" name="loginName" ng-required="true" ng-maxlength="32"
                                       ng-model="admin.a_login_name" type="text">
                            </div>
                            <div ng-show="myForm.loginName.$dirty && myForm.loginName.$error.maxlength"
                                 class="alert alert-danger help-block">
                                不能超过16个字符
                            </div>
                        </div>
                        <div class="form-group"
                             ng-class="{'has-error' : myForm.password.$dirty && myForm.password.$invalid}">
                            <label class="control-label col-lg-2">密码</label>
                            <div class="col-lg-5">
                                <input class="form-control" name="password" ng-maxlength="32" ng-required="true"
                                       ng-model="admin.a_login_password" type="text">
                            </div>
                            <div ng-show="myForm.password.$dirty && myForm.password.$error.maxlength"
                                 class="alert alert-danger help-block">
                                不能超过32个字符
                            </div>
                        </div>
                        <div class="form-group"
                             ng-class="{'has-error': myForm.repass.$dirty && (admin.a_login_password != admin.re_password) }">
                            <label class="control-label col-lg-2">确认密码</label>
                            <div class="col-lg-5">
                                <input class="form-control" name="repass" ng-model="admin.re_password" type="text">
                            </div>
                            <div ng-show="myForm.repass.$dirty && (myForm.password.$dirty && myForm.password.$error.maxlength)"
                                 class="alert alert-danger help-block">
                                不能超过32个字符
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-lg-2">性别</label>
                            <div class="col-lg-5">
                                <label class="radio-inline">
                                    <input type="radio" ng-required="true" name="sex" ng-model="admin.a_sex" value="1"
                                           ng-checked="admin.a_sex==1"/> 男
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" ng-required="true" name="sex" ng-model="admin.a_sex" value="0"
                                           ng-checked="admin.a_sex==0"/> 女
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                          <label class="control-label col-lg-2">角色</label>
							<div class="col-lg-2">
								<div class="checkbox" ng-repeat="role in rolesList">
			                        <label>
			                            <input type="checkbox" ng-click="toggleCheckBox(role.id)" value="{{role.id}}" name="roleIds" ng-checked="roleChecked_{{role.id}}"/> 
			                            <span ng-bind="role.r_name"></span>
			                        </label>
			                    </div>
							</div>                         
                        </div>
                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-10">
                                <button class="btn btn-danger" ng-disabled="myForm.$invalid" type="button"
                                        ng-click="save()">保存
                                </button>
                                <button class="btn btn-default" type="button" ng-click="back()">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </section>
    </div>
</div>